import axios from '@/utils/axios'

/** *****************代理********************/
// 代理支付宝微信充值二维码
export function createQrCode(data) {
  return axios({
    url: '/sp_admin/agent/createQrCode',
    method: 'post',
    data: data
  })
}
export function pcAliPay(data) {
  return axios({
    url: '/sp_admin/aliPcPay/pcAliPay',
    method: 'post',
    returnResult: true,
    data: data
  })
}
export function queryPcAliStatus(params) {
  return axios({
    url: '/sp_admin/aliPcPay/queryPcAliStatus',
    method: 'get',
    hideMessage: true,
    params
  })
}
export function checkUpFlowBalance(params) {
  return axios({
    url: '/sp_admin/aliPcPay/checkUpFlowBalance',
    method: 'get',
    params
  })
}
// 流量余额记录
export function agtGetFlowBalanceRecord(data) {
  return axios({
    url: '/sp_admin/agent/getFlowBalanceRecord',
    method: 'post',
    data: data
  })
}
// 代理支付
export function agentPay(data) {
  return axios({
    url: '/sp_admin/agent/agentPay',
    method: 'post',
    data: data
  })
}
// 获取可选套餐
export function agtGetPackageInfo(data) {
  return axios({
    url: '/sp_admin/agent/getPackageInfo',
    method: 'post',
    data
  })
}

// 获取流量余额
export function agtGetFlowBalance(params) {
  return axios({
    url: '/sp_admin/agent/getFlowBalance',
    method: 'get',
    params
  })
}
// 获取钱包数据
export function agtGetWallBalance(params) {
  return axios({
    url: '/sp_admin/agent/getWallBalance',
    method: 'get',
    params
  })
}
// 获取预警弹窗
export function agentFlowAlert(params) {
  return axios({
    url: '/sp_admin/agent/agentFlowAlert',
    method: 'get',
    params
  })
}
// 详情
export function agtOutDetail(params) {
  return axios({
    url: '/sp_admin/agent/outDetail',
    method: 'post',
    params
  })
}
/** *****************代理结束********************/
/** *****************机构********************/

// 获取流量余额
export function tenantGetFlowBalance(params) {
  return axios({
    url: '/sp_admin/tenant/getFlowBalance',
    method: 'get',
    params
  })
}
// 获取流量记录
export function tenantGetFlowBalanceRecord(data) {
  return axios({
    url: '/sp_admin/tenant/getFlowBalanceRecord',
    method: 'post',
    data
  })
}
// 获取公户信息
export function tenGetCollectionPublicInfo(data) {
  return axios({
    url: '/sp_admin/tenant/getCollectionPublicInfo',
    method: 'post',
    data
  })
}
// 提交充值记录
export function commitRecharge(data) {
  return axios({
    url: '/sp_admin/tenant/commitRecharge',
    method: 'post',
    data
  })
}
// 获取机构折扣信息和可获流量
export function tenGetTenantDiscount(params) {
  return axios({
    url: '/sp_admin/tenant/getTenantDiscount',
    method: 'get',
    params
  })
}
// 购买查看详情
export function tenInDetail(params) {
  return axios({
    url: '/sp_admin/tenant/inDetail',
    method: 'post',
    params
  })
}
// 出售查看详情
export function tenOutDetail(params) {
  return axios({
    url: '/sp_admin/tenant/outDetail',
    method: 'post',
    params
  })
}
// 机构导出excel
export const tenantExport = data => {
  return axios({
    url: '/sp_admin/tenant/export',
    method: 'post',
    responseType: 'blob',
    data
  })
}

/** *****************机构结束********************/
